import requests

from 封装 import SendMethod


class Event:
    def __init__(self):
        self.url = 'http://127.0.0.1:8000/'

    def add_event(self, payload):
        method = 'post'
        url = self.url + 'api/add_event/'
        return SendMethod.send_method(method, url, data=payload)

    def get_event(self, params_sb):
        method = 'get'
        url = self.url + 'api/get_event_list/'
        return SendMethod.send_method(method=method, url=url, params=params_sb)

if __name__ == '__main__':
    # payload = {
    #     'eid': 7722,
    #     'name': 'requests发布会21',
    #     'limit': 3,
    #     'status': 1,
    #     'address': 'A202教室',
    #     'start_time': '2023-7-31 12:30:30'
    # }
    # print(Event().add_event(payload))
    params = {"eid": "772"}
    print(Event().get_event(params))
